﻿using Dataweb.NShape.Advanced;

namespace cz.zcu.PreSti.Shapes
{
    public static class NShapeLibraryInitializer
    {

        public static void Initialize(IRegistrar registrar)
        {
            registrar.RegisterLibrary(namespaceName, preferredRepositoryVersion);

            registrar.RegisterModelObjectType(new GenericModelObjectType("TriggerModel", namespaceName, namespaceName,
                TriggerModel.CreateInstance, TriggerModel.GetPropertyDefinitions, 2));
            registrar.RegisterModelObjectType(new GenericModelObjectType("ImageStimulusModel", namespaceName, namespaceName,
                ImageStimulusModel.CreateInstance, ImageStimulusModel.GetPropertyDefinitions, 12));
            registrar.RegisterModelObjectType(new GenericModelObjectType("SoundStimulusModel", namespaceName, namespaceName,
                SoundStimulusModel.CreateInstance, SoundStimulusModel.GetPropertyDefinitions, 3));
            registrar.RegisterModelObjectType(new GenericModelObjectType("TextStimulusModel", namespaceName, namespaceName,
                TextStimulusModel.CreateInstance, TextStimulusModel.GetPropertyDefinitions, 9));
            registrar.RegisterModelObjectType(new GenericModelObjectType("UniformDistributionGeneratorModel", namespaceName, namespaceName,
                UniformDistributionGeneratorModel.CreateInstance, UniformDistributionGeneratorModel.GetPropertyDefinitions, 1));
            registrar.RegisterModelObjectType(new GenericModelObjectType("NormalDistributionGeneratorModel", namespaceName, namespaceName,
                NormalDistributionGeneratorModel.CreateInstance, NormalDistributionGeneratorModel.GetPropertyDefinitions, 1));
            registrar.RegisterModelObjectType(new GenericModelObjectType("ExponentialDistributionGeneratorModel", namespaceName, namespaceName,
                ExponentialDistributionGeneratorModel.CreateInstance, ExponentialDistributionGeneratorModel.GetPropertyDefinitions, 1));
            registrar.RegisterModelObjectType(new GenericModelObjectType("DiscreteGeneratorModel", namespaceName, namespaceName,
                DiscreteGeneratorModel.CreateInstance, DiscreteGeneratorModel.GetPropertyDefinitions, 1));
            registrar.RegisterModelObjectType(new GenericModelObjectType("SplitterModel", namespaceName, namespaceName,
                SplitterModel.CreateInstance, SplitterModel.GetPropertyDefinitions, 7));
            registrar.RegisterModelObjectType(new GenericModelObjectType("MixerModel", namespaceName, namespaceName,
                MixerModel.CreateInstance, MixerModel.GetPropertyDefinitions, 6));
            registrar.RegisterModelObjectType(new GenericModelObjectType("InputMouseModel", namespaceName, namespaceName,
                InputMouseModel.CreateInstance, InputMouseModel.GetPropertyDefinitions, 5));
            registrar.RegisterModelObjectType(new GenericModelObjectType("InputKeyboardModel", namespaceName, namespaceName,
                InputKeyboardModel.CreateInstance, InputKeyboardModel.GetPropertyDefinitions, 5));
            registrar.RegisterModelObjectType(new GenericModelObjectType("OutputModel", namespaceName, namespaceName,
                OutputModel.CreateInstance, OutputModel.GetPropertyDefinitions, 2));
            registrar.RegisterModelObjectType(new GenericModelObjectType("RepeaterModel", namespaceName, namespaceName,
                RepeaterModel.CreateInstance, RepeaterModel.GetPropertyDefinitions, 5));
            registrar.RegisterModelObjectType(new GenericModelObjectType("SubdiagramModel", namespaceName, namespaceName,
                SubdiagramModel.CreateInstance, SubdiagramModel.GetPropertyDefinitions, 16));
            registrar.RegisterModelObjectType(new GenericModelObjectType("SetterModel", namespaceName, namespaceName,
                SetterModel.CreateInstance, SetterModel.GetPropertyDefinitions, 1));
            registrar.RegisterModelObjectType(new GenericModelObjectType("GetterModel", namespaceName, namespaceName,
                GetterModel.CreateInstance, GetterModel.GetPropertyDefinitions, 1));

            registrar.RegisterShapeType(new ShapeType("Trigger", namespaceName, namespaceName,
                TriggerArrow.CreateInstance, TriggerArrow.GetPropertyDefinitions));
            registrar.RegisterShapeType(new ShapeType("Connector", namespaceName, namespaceName,
                ConnectorArrow.CreateInstance, ConnectorArrow.GetPropertyDefinitions));
            registrar.RegisterShapeType(new ShapeType("EntryPoint", namespaceName, namespaceName,
                EntryPointSymbol.CreateInstance, EntryPointSymbol.GetPropertyDefinitions));
            registrar.RegisterShapeType(new ShapeType("ExitPoint", namespaceName, namespaceName,
                ExitPointSymbol.CreateInstance, ExitPointSymbol.GetPropertyDefinitions));
            /*registrar.RegisterShapeType(new ShapeType("Trial", namespaceName, namespaceName,
                TrialSymbol.CreateInstance, TrialSymbol.GetPropertyDefinitions));*/
            registrar.RegisterShapeType(new ShapeType("ImageStimulus", namespaceName, namespaceName,
                ImageStimulusSymbol.CreateInstance, ImageStimulusSymbol.GetPropertyDefinitions));
            registrar.RegisterShapeType(new ShapeType("SoundStimulus", namespaceName, namespaceName,
                SoundStimulusSymbol.CreateInstance, SoundStimulusSymbol.GetPropertyDefinitions));
            registrar.RegisterShapeType(new ShapeType("TextStimulus", namespaceName, namespaceName,
                TextStimulusSymbol.CreateInstance, TextStimulusSymbol.GetPropertyDefinitions));
            registrar.RegisterShapeType(new ShapeType("UniformDistributionGenerator", namespaceName, namespaceName,
                UniformDistributionGeneratorSymbol.CreateInstance, UniformDistributionGeneratorSymbol.GetPropertyDefinitions));
            registrar.RegisterShapeType(new ShapeType("NormalDistributionGenerator", namespaceName, namespaceName,
                NormalDistributionGeneratorSymbol.CreateInstance, NormalDistributionGeneratorSymbol.GetPropertyDefinitions));
            registrar.RegisterShapeType(new ShapeType("ExponentialDistributionGenerator", namespaceName, namespaceName,
                ExponentialDistributionGeneratorSymbol.CreateInstance, ExponentialDistributionGeneratorSymbol.GetPropertyDefinitions));
            registrar.RegisterShapeType(new ShapeType("DiscreteGenerator", namespaceName, namespaceName,
                DiscreteGeneratorSymbol.CreateInstance, DiscreteGeneratorSymbol.GetPropertyDefinitions));
            registrar.RegisterShapeType(new ShapeType("Splitter", namespaceName, namespaceName,
                SplitterSymbol.CreateInstance, SplitterSymbol.GetPropertyDefinitions));
            registrar.RegisterShapeType(new ShapeType("Mixer", namespaceName, namespaceName,
                MixerSymbol.CreateInstance, MixerSymbol.GetPropertyDefinitions));
            registrar.RegisterShapeType(new ShapeType("InputMouse", namespaceName, namespaceName,
                InputMouseSymbol.CreateInstance, InputMouseSymbol.GetPropertyDefinitions));
            registrar.RegisterShapeType(new ShapeType("InputKeyboard", namespaceName, namespaceName,
                InputKeyboardSymbol.CreateInstance, InputKeyboardSymbol.GetPropertyDefinitions));
            registrar.RegisterShapeType(new ShapeType("Output", namespaceName, namespaceName,
                OutputSymbol.CreateInstance, OutputSymbol.GetPropertyDefinitions));
            registrar.RegisterShapeType(new ShapeType("Repeater", namespaceName, namespaceName,
                RepeaterSymbol.CreateInstance, RepeaterSymbol.GetPropertyDefinitions));
            registrar.RegisterShapeType(new ShapeType("Subdiagram", namespaceName, namespaceName,
                SubdiagramSymbol.CreateInstance, SubdiagramSymbol.GetPropertyDefinitions));
            registrar.RegisterShapeType(new ShapeType("Setter", namespaceName, namespaceName,
                SetterSymbol.CreateInstance, SetterSymbol.GetPropertyDefinitions));
            registrar.RegisterShapeType(new ShapeType("Getter", namespaceName, namespaceName,
                GetterSymbol.CreateInstance, GetterSymbol.GetPropertyDefinitions));
        
                }
        private const string namespaceName = "PreStiShapes";
        private const int preferredRepositoryVersion = 2;
    }
}
